//
//  SSDKBaseResData.h
//  SuperSDK
//
//  Created by wyht－ios－dev on 15/10/7.
//  Copyright © 2015年 WYHT. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface SSDKBaseResData : NSObject

extern NSString * const STATUS_OK;

extern NSString * const STATUS_FAIL;

@property (nonatomic, strong, readwrite) NSString *status;

@property (nonatomic, strong, readwrite) NSMutableDictionary *data;

@property (nonatomic, strong, readwrite) NSMutableDictionary *common;

@property (nonatomic, strong, readwrite) NSMutableDictionary *extra;

- (instancetype) initWithDictionary : (NSMutableDictionary *) dictionary;

- (BOOL) isOk;

- (instancetype) fail;

- (instancetype) ok;

- (instancetype) setError : (NSString *) error
                 withCode : (NSInteger) errCode;

- (instancetype) setError : (NSString *) error
                 withCode : (NSInteger) errCode
                  withMsg : (NSString *) msg;

- (NSString *) appId;

- (instancetype) setAppId : (NSString *) appId;

- (NSString *) sdkId;

- (instancetype) setSdkId : (NSString *) sdkId;

- (NSString *) channelId;

- (instancetype) setChannelId : (NSString *) channelId;

- (NSString *) error;

- (int) errorNo;

- (NSString *) errorMsg;

- (instancetype) setErrorMsg : (NSString *) msg;

- (NSString *) dataWithKey : (NSString *) key;

- (instancetype) setDataValue : (NSString *) value
                       forKey : (NSString *) key;

- (NSString *) extraWithKey : (NSString *) key;

- (instancetype) setExtraValue : (NSString *) value
                        forKey : (NSString *) key;

- (NSString *) toJson;

@end
